<?php
/**
 * Game_Event_Research
 *
 * Класс Game_Event_Research отвечает за события исследования юнитов
 *
 * @author Дмитрий Кузьма <kouzma.d@gmail.com>
 * @version 1.0
 */
class Game_Event_Research extends Game_Event_Item {

	protected static $_eventType = 'research';
	
	/**
	 * (non-PHPdoc)
	 * @see Game_Event_Item::finish()
	 */
	public function finish($isAutoDeleteEvent = true) {
		$objEventInfo = $this->_objEvent;
		$stmt = "
			INSERT IGNORE 
			INTO `place_research`
			(
				`ID_place`, 
				`ID_unit`, 
				`is_researched`
			)
			VALUES(
				" . $objEventInfo->getField('ID_place') . ",
				" . $objEventInfo->getField('ID_essence') . ",
				1
			)
		";
		$objDB = Service_Database::instance();
		$objDB->query($stmt);
		if ($isAutoDeleteEvent) $this->_deleteEvent();
	}

	
}
?>